* @return string
*/
public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
- return self::userToolLinks( $userId, $userText, true, 0, $edits );
+ return self::userToolLinks( $userId, $userText, true, 0, $edits, false );
}
/**
* @since 1.16.3
* @param Revision $rev
* @param bool $isPublic Show only if all users can see it
+ * @param bool $useParentheses (optional) Wrap comments in parentheses where needed
* @return string HTML
*/
- public static function revUserTools( $rev, $isPublic = false ) {
+ public static function revUserTools( $rev, $isPublic = false, $useParentheses = true ) {
if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
$link = wfMessage( 'rev-deleted-user' )->escaped();
} elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
$userId = $rev->getUser( Revision::FOR_THIS_USER );
$userText = $rev->getUserText( Revision::FOR_THIS_USER );
$link = self::userLink( $userId, $userText )
- . self::userToolLinks( $userId, $userText );
+ . self::userToolLinks( $userId, $userText, false, 0, null,
+ $useParentheses );
} else {
$link = wfMessage( 'rev-deleted-user' )->escaped();
}
if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
- return ' <span class="history-deleted">' . $link . '</span>';
+ return ' <span class="history-deleted mw-userlink">' . $link . '</span>';
}
return $link;
}
$block = " <span class=\"comment\">" . wfMessage( 'rev-deleted-comment' )->escaped() . "</span>";
}
if ( $rev->isDeleted( Revision::DELETED_COMMENT ) ) {
- return " <span class=\"history-deleted\">$block</span>";
+ return " <span class=\"history-deleted comment\">$block</span>";
}
return $block;
}
$stxt = wfMessage( 'historyempty' )->escaped();
} else {
$stxt = wfMessage( 'nbytes' )->numParams( $size )->escaped();
- $stxt = wfMessage( 'parentheses' )->rawParams( $stxt )->escaped();
}
- return "<span class=\"history-size\">$stxt</span>";
+ return "<span class=\"history-size mw-diff-bytes\">$stxt</span>";
}
/**
static function splitTrail( $trail ) {
$regex = MediaWikiServices::getInstance()->getContentLanguage()->linkTrail();
$inside = '';
- if ( $trail !== '' ) {
- $m = [];
- if ( preg_match( $regex, $trail, $m ) ) {
- $inside = $m[1];
- $trail = $m[2];
- }
+ if ( $trail !== '' && preg_match( $regex, $trail, $m ) ) {
+ list( , $inside, $trail ) = $m;
}
return [ $inside, $trail ];
}
$inner = $context->msg( 'brackets' )->rawParams( $inner )->escaped();
}
- /**
- * FIXME
- * Remove all references to DisableRollbackConfirmationFeature
- * after release of rollback feature. See T199534
- */
- if ( !MediaWikiServices::getInstance()
- ->getMainConfig()->get( 'DisableRollbackConfirmationFeature' ) &&
- $context->getUser()->getBoolOption( 'showrollbackconfirmation' )
- ) {
+ if ( $context->getUser()->getBoolOption( 'showrollbackconfirmation' ) ) {
$stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
$stats->increment( 'rollbackconfirmation.event.load' );
$context->getOutput()->addModules( 'mediawiki.page.rollback.confirmation' );